package com.xueyi.aixihu.entity.vo;

import com.xueyi.aixihu.entity.po.AxhFinanceLog;
import lombok.Data;
import org.springframework.util.StringUtils;


/**
 * 描述 财务报表LogVo
 *
 * @auther 俞烨
 * @date 2022-08-17 17
 */
@Data
public class AxhAuditFinanceLogVo extends AxhFinanceLog {

    private Integer id;
    private String title;
    private String username;
    private Integer areaType;
    /**
     * 0 等待审核（蓝色）
     * 1 等待审核（灰色）
     * 2 已通过审核
     * 3 当前阶段已被驳回
     */
    private Integer wait;


    private String waitStr;

    @Override
    public void setLogContent(String logContent) {
        super.setLogContent(logContent);
        if (StringUtils.hasLength(logContent)) {
            if (logContent.contains("驳回")) {
                setWait(3);
            } else {
                setWait(2);
            }
        }
    }

    public void setWait(Integer wait) {
        this.wait = wait;

        if (this.wait.equals(0) || this.wait.equals(1)) {
            waitStr = "待审核";
        } else if (this.wait.equals(2)) {
            waitStr = "已通过";
        } else {
            waitStr = "已驳回";
        }
    }
}
